package org.lagou.demo.controller;

import org.lagou.demo.service.IDemoService;
import org.lagou.edu.mvcframework.annotations.JyAutowired;
import org.lagou.edu.mvcframework.annotations.JyController;
import org.lagou.edu.mvcframework.annotations.JyRequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@JyController
@JyRequestMapping("/demo")
public class DemoController {

    @JyAutowired
    private IDemoService iDemoService;

    @JyRequestMapping("/query")
    public String query(HttpServletRequest req, HttpServletResponse resp, String name) {

        return iDemoService.getName(name);

    }
}
